{include file="public_head" /}

<!-- datatables -->
<link href="__STATIC__/js/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<!-- chk_3 -->
<link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>

<body class="nav-md">

<div class="container body">


    <div class="main_container">

        {include file="public_sidebar,public_nav" /}


        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                        <h3>
                            拍卖活动管理
                        </h3>
                    </div>
                </div>
                <div class="clearfix"></div>

                <div class="row">

                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}</h2>
                                <a style="float: right" href="{:url('console/Auction/create')}"
                                   class="btn btn-success btn-sm">创建拍卖活动</a>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <form name="form" id="form" method="get" action="">
                                    <div class="title_left col-md-12 col-sm-12 col-xs-12">

                                        <div class="col-md-2 col-sm-3 col-xs-6 form-group pull-left top_search">
                                            <div class="input-group" style="width: 80%;">
                                                <input type="text" class="form-control" name="title" style="width: 100%"
                                                       placeholder="输入搜索内容..." value="{:input('title')}">
                                            </div>
                                        </div>
                                        <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索
                                        </button>
                                    </div>

                                    <table class="table table-striped table-bordered">
                                        <thead>
                                        <tr>
                                            <th>拍卖活动名称</th>
                                            <th>活动开始时间</th>
                                            <th>活动预计结束时间</th>
                                            <th>活动状态</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>

                                        <tbody>
                                        {empty name="data"}
                                        <tr>
                                            <td colspan="10">
                                                <div style='font-size:24px;margin:30px 0;'>没有找到记录</div>
                                            </td>
                                        </tr>
                                        {/empty}
                                        {volist name="data" id="item"}
                                        <tr>
                                            <td>{$item.title}</td>
                                            <td>{$item.start_time|date='Y-m-d H:i:s',###}</td>
                                            <td>{$item.end_time|date='Y-m-d H:i:s',###}</td>
                                            {if condition="$item.start_time gt time()"}
                                            <td>未开始</td>
                                            {else/}
                                            {if condition="$item.end_time gt time()"}
                                            <td>进行中</td>
                                            {else/}
                                            <td>已结束</td>
                                            {/if}
                                            {/if}
                                            <td class="operate">

                                                <div>
                                                    <a href="{:url('AuctionGoods/index', ['id' => $item['id']])}"
                                                       class="label label-info">
                                                        <span class="fa fa-pencil"></span>&nbsp;&nbsp;查看活动商品
                                                    </a>
                                                    <a href="{:url('Auction/update', ['id' => $item['id']])}"
                                                       class="label label-primary">
                                                        <span class="fa fa-pencil"></span>&nbsp;&nbsp;编 辑
                                                    </a>
                                                    <!--<a href="{:url('GroupPurchase/destroy', ['id' => $item['id']])}"-->
                                                       <!--class="label label-danger"-->
                                                       <!--onClick="return confirm('确定删除吗?')"-->
                                                    <!--&gt;-->
                                                        <!--<span class="fa fa-times"></span>&nbsp;&nbsp;删 除-->
                                                    <!--</a>-->
                                                </div>
                                            </td>
                                        </tr>
                                        {/volist}
                                        </tbody>
                                        <!--<tbody align="left">-->
                                        <!--<tr>-->
                                            <!--<td colspan="10">-->
                                                <!--<span>控制：</span>-->
                                                <!--<a style="color:#428BCA"-->
                                                   <!--href="javascript:UpOrderID('{:url(\'ShopGoods/sorting\')}');">更新排序</a>-->
                                            <!--</td>-->
                                        <!--</tr>-->
                                        <!--</tbody>-->
                                    </table>
                                    <!-- 分页 -->
                                    <div style="float: right;margin-top: -30px;">{$data->render()}</div>
                                </form>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </div>
        <!-- /page content -->
    </div>

</div>

{include file="public_foot" /}
<!--select-->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<!-- public -->
<script src="__STATIC__/js/public.js"></script>
<!-- layer -->
<script src="__STATIC__/js/layer.js"></script>
<script type="text/javascript">
    function qrcode(id) {
        $.ajax({
            url: "{:url('ShopGoods/create_qrcode')}",
            data: {'type': 0, 'id': id},
            type: 'post',
            dataType: 'json',
            success: function (data) {
                if (data) {
                    window.open(data);
                } else {
                    layer.msg('生成二维码失败');
                }
            }
        })
    }
    // list
    $(document).ready(function () {
        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
        $(".select2-container").css({width: "80%"})
        $(".form-group:first-of-type .select2-container").css({width: "96%"})
    });
</script>